package u1project.server;

import java.io.IOException;
import java.net.ServerSocket;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author oldliu
 * @since 1.0
 */
public class MainServer {
    public static void main(String[] args) {
        ExecutorService es = Executors.newFixedThreadPool(30);
        try {
            ServerSocket sc = new ServerSocket(8888);
            System.out.println("on 8888端口");
            while (true) {
                es.execute(new ServerThread(sc.accept()));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
